moddbfandomcom-20200213-history
Image Formats
Different image formats have different strong and weak points; it is important to be aware of these in order to chose the right format for the task at hand. Raster Formats General Information The below table exists to compare various common raster image formats. Please note that not all image formats are present in this table. # There are current patents on the S3TC compression techniques; as such, it is illegal to implement S3TC/DXTn compression without a license. Keep in mind, however, that video card vendors have already obtained this license to decompress S3TC/DXTn in hardware; so long as you do not compress/decompress in your own code, you do not need a license. # Originally, the compression used by GIF was patented by Unisys, preventing free use. Since August, 2004, however, all relevant patents have exipred (see Unisys and LZW patent enforcement on Wikipedia.) # There is a related format called "Motion JPEG" used for video files; however, this is not directly part of the JPEG format itself. # There have been various patents asserted over JPEG in its lifetime, although all known patents have either expired or been ruled invalid. That said, as a widely used, popular image format, there may yet be submarine patents that have not yet come to light. # Whilst the core parts of JPEG 2000 are stated to be freely implementable, many advanced features require licensing fees to implement. # There are two standards which provide an animated PNG-style format: MNG and APNG. MNG is a relatively large, complex standard that has not seen wide adoption but is championed by the creators of PNG. APNG is a simple modification to the standard PNG format to support multiple frames, and has found support from several web browser vendors. # TGA optionally supports RLE compression, although it is commonly used without compression at all. ; Explanation of columns ; RGB : format support for direct RGB color, and in what bit-depth(s). ; RGBA : format support for direct RGBA color, or RGB plus an alpha mask, and in what bit-depth(s). ; Grayscale : format support for grayscale images, and in what bit-depth(s). ; Indexed : does the format support 8-bit indexed (or paletted) images. ; HDR : can the format store High Dynamic Range (a.k.a. floating-point) image data? ; Animation : does the format support sequenced frame animation or better? ; Compression : what, if any, compression method(s) does the format use? ; Free : is the format free of patents and/or licensing fees? ; Extensible : can additional information be attached to images whilst retaining compatibility with existing tools? BMP Pros: * Widely supported. Cons: * Produces large files. * Does not support alpha transparency. DDS Pros: * Native format for S3TC/DXTn compression—compressed image data can be uploaded directly to video card memory. * Supports other features like cube maps, mip maps, etc. Cons: * Compression format is patented, requiring a license to compress or decompress outside of hardware. * No support for lossless compression. GIF Pros: * Supports animation. Cons: * Very low visual quality. * For still images of identical quality, PNG is always smaller. JPEG Pros: * Good lossy compression. * Widely supported and implemented—there are a number of freely available libraries for it. Cons: * Can produce noticeable compression artifacts. * Is not natively supported by video cards. * No support for lossless compression. JPEG 2000 Pros: * Very advanced format. * High color depth. * Advanced lossy compression (wavelets). * Lossless compression. Cons: * Not as widely supported as JPEG yet. * Patent concerns exist. PCX Pros: * Old, fairly established format. Cons: * Support for it is waning. * Limited color depth. PNG Pros: * Well documented, standardised format. * Widely supported and implemented—reference implementation freely available. * Supports very high depth images (48-bit RGB, 64-bit RGBA and 16-bit grayscale). * One of the best-performing lossless formats. Cons: * No support for floating-point images. * No support for lossy compression. TGA Pros: * Incredibly simple format for uncompressed images. * Widely supported and implemented. Cons: * Somewhat archaic and difficult to implement for other-than uncompressed RGB/RGBA images. TIFF Pros: * Very flexible, supports a wide variety of image formats both lossy and lossless. * Supports very high color depth. Cons: * Very difficult to implement. * Has a huge number of features that might potentially need to be supported. Vector Formats General Information